package sdc.media.motorbike;

import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.PowerManager;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.FrameLayout;

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.google.ads.AdRequest;
import com.google.ads.AdView;

public class MainActivity extends AndroidApplication {
	Handler noticeHandler;

	MotorBike game;

	FrameLayout frameLayout;

//	FBShare share;

	private PowerManager.WakeLock wl;
	AdView adView;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		// AndroidApplicationConfiguration cfg = new
		// AndroidApplicationConfiguration();
		// cfg.useGL20 = true;
		// cfg.useAccelerometer = true;
		//
		// initialize(new MotorBike(), cfg);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
		getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

		AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
		cfg.useGL20 = true;
		cfg.useAccelerometer = true;

		noticeHandler = new Handler();
		setContentView(R.layout.main);
		frameLayout = (FrameLayout) findViewById(R.id.main_frame);

		game = new MotorBike();

		frameLayout.addView(initializeForView(game, cfg));

		adView = (AdView) this.findViewById(R.id.adview);
		adView.setVisibility(View.VISIBLE);
		adView.loadAd(new AdRequest());
	}
}